using System.Collections.Generic;
using System.Data.Entity;
using EfSample.Model.Ef.Mappings;

namespace EfSample.Model.Ef
{
    public class EfDbContext : DbContext
    {
        public IList<IMapping> Mappings { get; set; }
        
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            foreach (var mapping in Mappings)
            {
                mapping.RegistTo(modelBuilder.Configurations);
            }
        }
    }
}